popover: Always measure contents gizmo
authorTimm Bäder <mail@baedert.org>
Sat, 16 Mar 2019 05:16:43 +0000 (06:16 +0100)
committerTimm Bäder <mail@baedert.org>
Mon, 25 Mar 2019 14:57:31 +0000 (15:57 +0100)
Otherwise we're getting warnings about allocating a widget we haven't
measured first, which is fair. The contents gizmo itself will later take
care about whether or not the real popover child is NULL.

gtk/gtkpopover.c

index e118eb0e1f3155433e48cf3e9f4a40c37cc68437..a39270c5a792438353d95500bca556f2d8b5460d 100644 (file)
@@ -1370,19 +1370,15 @@ gtk_popover_measure (GtkWidget      *widget,
 {
   GtkPopover *popover = GTK_POPOVER (widget);
   GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
-  GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
   int minimal_size;
 
   *minimum = 0;
   *natural = 0;
 
-  if (child != NULL)
-    {
-      if (for_size >= 0)
-        for_size -= TAIL_HEIGHT;
+  if (for_size >= 0)
+    for_size -= TAIL_HEIGHT;
 
-      gtk_widget_measure (priv->contents_widget, orientation, for_size, minimum, natural, NULL, NULL);
-    }
+  gtk_widget_measure (priv->contents_widget, orientation, for_size, minimum, natural, NULL, NULL);
 
   minimal_size = get_minimal_size (popover, orientation);
   *minimum = MAX (*minimum, minimal_size);